package com.oracle.sbdb.testdao;

import java.util.List;

import org.junit.Test;

import com.oracle.sbdb.dao.BugInfoDao;
import com.oracle.sbdb.model.BugInfo;



public class BugInfoDaoTest {

//	@Test
	public void testInsert() {
		BugInfo bugInfo = new BugInfo();
		bugInfo.setBug_subject("The performance of Oracle 12.c is not good enough");
		bugInfo.setAssignee_id(25160);
		bugInfo.setBug_os_id(267);
		bugInfo.setBug_os_release("Solaris s11.3");
		bugInfo.setBug_type(1);
		bugInfo.setComponent_id(1);
		bugInfo.setCustomer("China Moblie");
		bugInfo.setGen_prt('G');
		bugInfo.setProduct_id(1);
		bugInfo.setSeverity(3);
		bugInfo.setStatus(11);
		bugInfo.setSupport_id(25160);
		
		BugInfoDao dao = new BugInfoDao();
		dao.insert(bugInfo);
	}
	@Test
	public void testInsert1() {
		BugInfo bugInfo = new BugInfo();
		bugInfo.setBug_subject("Server hang when running Oracle 12.c");
		bugInfo.setAssignee_id(25160);
		bugInfo.setBug_os_id(173);
		bugInfo.setBug_os_release("Solaris s11.4");
		bugInfo.setBug_type(1);
		bugInfo.setComponent_id(1);
		bugInfo.setCustomer("China Moblie");
		bugInfo.setGen_prt('G');
		bugInfo.setProduct_id(1);
		bugInfo.setSeverity(3);
		bugInfo.setStatus(11);
		bugInfo.setSupport_id(25160);
		
		BugInfoDao dao = new BugInfoDao();
		dao.insert(bugInfo);
	}
	
//	@Test
	public void testSelectandUpdate() {
		BugInfoDao dao = new BugInfoDao();
		BugInfo bugInfo = dao.selectbyId(0);
		System.out.println(bugInfo.toString());
		dao.update(bugInfo);
	}
	
//	@Test
	public void testSelectandInsert() {
		BugInfoDao dao = new BugInfoDao();
		BugInfo bugInfo = dao.selectbyId(0);
		bugInfo.setBug_id(1);
		dao.insert(bugInfo);
	}
	
//	@Test
	public void testSelectAll() {
		BugInfoDao dao = new BugInfoDao();
		List<BugInfo> list = dao.selectAllBugInfo();
		System.out.println(list.size());
	}
	
//	@Test
	public void testSelectTime() {
		
	}

}
